<template>
  <div>
    <van-index-anchor index="热门城市" />
    <van-cell  v-for="(item, index) in hotCity" :key="index"  @click="changeFn(item.label)" :title="item.label"/>
  </div>
</template>

<script>
import { getCity } from '@/api/atticle'
export default {
  data () {
    return {
      hotCity: []
    }
  },
  methods: {
    changeFn (title) {
      console.log(title)
      this.$emit('change', title)
    }
  },
  async created () {
    const { body } = await getCity()
    console.log(body)
    this.hotCity.push(...body)
    console.log(this.hotCity)
    // this.allCity.push(...res.body)
  }
}
</script>

<style></style>
